#include <sstream>

#if defined(_UNICODE)
#define TSS std::wstringstream
#define TString std::wstring
#else
#define TSS std::stringstream
#define TString std::string
#endif

template<typename T1, typename... T2>
void unpacker(TSS& ss, const T1& t1, const T2&... t2){
    ss << t1 << _T(' ');
	unpacker(ss, t2...);
}

template<typename T>
void unpacker(TSS& ss, const T& t) {
	ss << t;
}

template<typename T1, typename... T2>
void Msg(const T1& t, const T2&... args)
{
	if (gMsgBox) {
		static TSS ss;
		unpacker(ss, t, args...);

		TString msg;
		msg = ss.str();
		ss.str(_T(""));
		gMsgBox->SendMessage(LB_ADDSTRING, 0u, (LPARAM)msg.c_str());
	}
}